#ifndef WX_MAINWINDOW_H
#define WX_MAINWINDOW_H
#include <wx/wx.h>
#include <wx/grid.h>
#include <vector>
#include "fund.h"
#include "fundbusidata.h"


class mainFrame : public wxFrame
{
public:
    mainFrame();

private:
    void initGUI();
    void initData();
    void initEvent();
    void onSizeEvent(wxSizeEvent &event);
    void onDeleteRow(wxCommandEvent &event);
    void onAddfund(wxCommandEvent& event);
    void onAddfundPlus(wxCommandEvent & event);
    void onClearFund(wxCommandEvent &event);
    void onExportFund(wxCommandEvent &event);
    void onFundNameInput(wxCommandEvent& event);
    void onFundCodeInput(wxCommandEvent& event);
    void onCellRightClick(wxCommandEvent& event);
    void addFundSingal(wxString &fund,wxArrayString& errFunds);
        

    void setParseChioceData();
    void setTaChioceData();
    bool generateDbf();
    bool generateCsv();

    void setTaFileFromPath();    
    void dealFundName(wxString & name);

    //data
private:
    std::vector<Ta> m_Tas;
    std::vector<Fund> m_Funds;
    std::vector<Parse> m_Parse;
    std::vector<TaInfo> m_checkInfos;

    //基金确认文件数据
    std::map<std::string,std::string> m_M07Funds;
    std::map<std::string,C2FundInfo> m_Mc2Funds;

    //程序参数
    std::map<std::string,std::string> m_Settings;

    // control
private:
    wxStaticText *m_staticTextTa;
    wxChoice *m_choiceTa;
    wxStaticText *m_staticTextFundCode;
    wxTextCtrl *m_textCtrlFundCode;
    wxStaticText *m_staticTextParse;
    wxChoice *m_choiceParse;
    wxStaticText *m_staticTextFundName;
    wxTextCtrl *m_textCtrlFundName;
    wxButton *m_buttonAddFund;
    wxButton *m_buttonClearFund;
    wxButton *m_buttonExportFund;
    wxGrid *m_gridFundData;
    wxMessageDialog *m_MessageDialog;
    
};

#endif